import UIKit

let xx = pow(3, 2)
//1.扩展
extension Int{
    func squared() -> Int {
        return self * self
    }
    
    var isEven: Bool{
        return self % 2 == 0
    }
}

let xxx = 3.squared()

4.isEven

//2.协议扩展
let arr = ["语文","数学","英语","数学","英语","语文"]
let s = Set(["小明", "小王", "小李"])

extension Collection{
    func summarize() {
        print("一共有\(count)个")
        
        for name in self {
            print(name)
        }
    }

}

arr.summarize()

s.summarize()
